﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="stats_organisms.aspx.cs"
    Inherits="MesopotamiaDCProxy.stats_organisms" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:FormView ID="fvCount" runat="server" DataSourceID="dsOrgCount">
            <EditItemTemplate>
                OrgCount:
                <asp:TextBox ID="OrgCountTextBox" runat="server" Text='<%# Bind("OrgCount") %>' />
                <br />
                <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update"
                    Text="Update" />
                &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False"
                    CommandName="Cancel" Text="Cancel" />
            </EditItemTemplate>
            <InsertItemTemplate>
                OrgCount:
                <asp:TextBox ID="OrgCountTextBox" runat="server" Text='<%# Bind("OrgCount") %>' />
                <br />
                <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert"
                    Text="Insert" />
                &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False"
                    CommandName="Cancel" Text="Cancel" />
            </InsertItemTemplate>
            <ItemTemplate>
                OrgCount:
                <asp:Label ID="OrgCountLabel" runat="server" Text='<%# Bind("OrgCount") %>' />
                <br />
            </ItemTemplate>
        </asp:FormView>
        <asp:ListView ID="lvAllOrgs" runat="server" DataKeyNames="OrganismID" 
            DataSourceID="dsAllOrgs" EnableViewState="False">
            <ItemTemplate>
                <tr style="background-color: #DCDCDC; color: #000000;">
                    <td>
                        <asp:Label ID="OrganismIDLabel" runat="server" Text='<%# Eval("OrganismID") %>' />
                    </td>
                    <td>
                        <asp:Label ID="GUIDLabel" runat="server" Text='<%# Eval("GUID") %>' />
                    </td>
                    <td>
                        <asp:Label ID="EnergyLabel" runat="server" Text='<%# Eval("Energy") %>' />
                    </td>
                    <td>
                        <asp:Label ID="FitnessLabel" runat="server" Text='<%# Eval("Fitness") %>' />
                    </td>
                    <td>
                        <asp:Label ID="MachineNameLabel" runat="server" Text='<%# Eval("MachineName") %>' />
                    </td>
                    <td>
                        <asp:Label ID="SynapsesLabel" runat="server" Text='<%# Eval("Synapses") %>' />
                    </td>
                    <td>
                        <asp:Label ID="NeuronsLabel" runat="server" Text='<%# Eval("Neurons") %>' />
                    </td>
                    <td>
                        <asp:Label ID="ChromsomesLabel" runat="server" 
                            Text='<%# Eval("Chromsomes") %>' />
                    </td>
                    <td>
                        <asp:Label ID="GenesLabel" runat="server" Text='<%# Eval("Genes") %>' />
                    </td>
                </tr>
            </ItemTemplate>
            <AlternatingItemTemplate>
                <tr style="background-color: #FFF8DC;">
                    <td>
                        <asp:Label ID="OrganismIDLabel" runat="server" Text='<%# Eval("OrganismID") %>' />
                    </td>
                    <td>
                        <asp:Label ID="GUIDLabel" runat="server" Text='<%# Eval("GUID") %>' />
                    </td>
                    <td>
                        <asp:Label ID="EnergyLabel" runat="server" Text='<%# Eval("Energy") %>' />
                    </td>
                    <td>
                        <asp:Label ID="FitnessLabel" runat="server" Text='<%# Eval("Fitness") %>' />
                    </td>
                    <td>
                        <asp:Label ID="MachineNameLabel" runat="server" 
                            Text='<%# Eval("MachineName") %>' />
                    </td>
                    <td>
                        <asp:Label ID="SynapsesLabel" runat="server" Text='<%# Eval("Synapses") %>' />
                    </td>
                    <td>
                        <asp:Label ID="NeuronsLabel" runat="server" Text='<%# Eval("Neurons") %>' />
                    </td>
                    <td>
                        <asp:Label ID="ChromsomesLabel" runat="server" 
                            Text='<%# Eval("Chromsomes") %>' />
                    </td>
                    <td>
                        <asp:Label ID="GenesLabel" runat="server" Text='<%# Eval("Genes") %>' />
                    </td>
                </tr>
            </AlternatingItemTemplate>
            <EmptyDataTemplate>
                <table runat="server" style="background-color: #FFFFFF; border-collapse: collapse;
                    border-color: #999999; border-style: none; border-width: 1px;">
                    <tr>
                        <td>
                            No data was returned.</td>
                    </tr>
                </table>
            </EmptyDataTemplate>
            <InsertItemTemplate>
                <tr style="">
                    <td>
                        <asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="Insert" />
                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Clear" />
                    </td>
                    <td>
                        <asp:TextBox ID="OrganismIDTextBox" runat="server" Text='<%# Bind("OrganismID") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="GUIDTextBox" runat="server" Text='<%# Bind("GUID") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="EnergyTextBox" runat="server" Text='<%# Bind("Energy") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="FitnessTextBox" runat="server" Text='<%# Bind("Fitness") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="MachineNameTextBox" runat="server" 
                            Text='<%# Bind("MachineName") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="SynapsesTextBox" runat="server" 
                            Text='<%# Bind("Synapses") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="NeuronsTextBox" runat="server" Text='<%# Bind("Neurons") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="ChromsomesTextBox" runat="server" 
                            Text='<%# Bind("Chromsomes") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="GenesTextBox" runat="server" Text='<%# Bind("Genes") %>' />
                    </td>
                </tr>
            </InsertItemTemplate>
            <LayoutTemplate>
                <table runat="server">
                    <tr runat="server">
                        <td runat="server">
                            <table id="itemPlaceholderContainer" runat="server" border="1" style="background-color: #FFFFFF;
                                border-collapse: collapse; border-color: #999999; border-style: none; border-width: 1px;
                                font-family: Verdana, Arial, Helvetica, sans-serif;">
                                <tr runat="server" style="background-color: #DCDCDC; color: #000000;">
                                    <th runat="server">
                                        OrganismID</th>
                                    <th runat="server">
                                        GUID</th>
                                    <th runat="server">
                                        Energy</th>
                                    <th runat="server">
                                        Fitness</th>
                                    <th runat="server">
                                        MachineName</th>
                                    <th runat="server">
                                        Synapses</th>
                                    <th runat="server">
                                        Neurons</th>
                                    <th runat="server">
                                        Chromsomes</th>
                                    <th runat="server">
                                        Genes</th>
                                </tr>
                                <tr id="itemPlaceholder" runat="server">
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr runat="server">
                        <td runat="server" style="text-align: center; background-color: #CCCCCC; font-family: Verdana, Arial, Helvetica, sans-serif;
                            color: #000000;">
                        </td>
                    </tr>
                </table>
            </LayoutTemplate>
            <EditItemTemplate>
                <tr style="background-color: #008A8C; color: #FFFFFF;">
                    <td>
                        <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="Update" />
                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Cancel" />
                    </td>
                    <td>
                        <asp:Label ID="OrganismIDLabel1" runat="server" Text='<%# Eval("OrganismID") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="GUIDTextBox" runat="server" Text='<%# Bind("GUID") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="EnergyTextBox" runat="server" Text='<%# Bind("Energy") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="FitnessTextBox" runat="server" Text='<%# Bind("Fitness") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="MachineNameTextBox" runat="server" 
                            Text='<%# Bind("MachineName") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="SynapsesTextBox" runat="server" 
                            Text='<%# Bind("Synapses") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="NeuronsTextBox" runat="server" Text='<%# Bind("Neurons") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="ChromsomesTextBox" runat="server" 
                            Text='<%# Bind("Chromsomes") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="GenesTextBox" runat="server" Text='<%# Bind("Genes") %>' />
                    </td>
                </tr>
            </EditItemTemplate>
            <SelectedItemTemplate>
                <tr style="background-color: #008A8C; font-weight: bold; color: #FFFFFF;">
                    <td>
                        <asp:Label ID="OrganismIDLabel" runat="server" Text='<%# Eval("OrganismID") %>' />
                    </td>
                    <td>
                        <asp:Label ID="GUIDLabel" runat="server" Text='<%# Eval("GUID") %>' />
                    </td>
                    <td>
                        <asp:Label ID="EnergyLabel" runat="server" Text='<%# Eval("Energy") %>' />
                    </td>
                    <td>
                        <asp:Label ID="FitnessLabel" runat="server" Text='<%# Eval("Fitness") %>' />
                    </td>
                    <td>
                        <asp:Label ID="MachineNameLabel" runat="server" 
                            Text='<%# Eval("MachineName") %>' />
                    </td>
                    <td>
                        <asp:Label ID="SynapsesLabel" runat="server" Text='<%# Eval("Synapses") %>' />
                    </td>
                    <td>
                        <asp:Label ID="NeuronsLabel" runat="server" Text='<%# Eval("Neurons") %>' />
                    </td>
                    <td>
                        <asp:Label ID="ChromsomesLabel" runat="server" 
                            Text='<%# Eval("Chromsomes") %>' />
                    </td>
                    <td>
                        <asp:Label ID="GenesLabel" runat="server" Text='<%# Eval("Genes") %>' />
                    </td>
                </tr>
            </SelectedItemTemplate>
        </asp:ListView>
    </div>
    <asp:SqlDataSource ID="dsAllOrgs" runat="server" ConnectionString="<%$ ConnectionStrings:GridWSDBConnectionString %>"
        
        
        SelectCommand="SELECT [OrganismID], [GUID], [Energy], [Fitness], [MachineName], [Synapses], [Neurons], [Chromsomes], [Genes] FROM [vw_scenarioOrganismForTest]"></asp:SqlDataSource>
    <asp:SqlDataSource ID="dsOrgCount" runat="server" ConnectionString="<%$ ConnectionStrings:GridWSDBConnectionString %>"
        SelectCommand="SELECT COUNT(DISTINCT OrganismID) AS OrgCount FROM vw_scenarioOrganismForTest">
    </asp:SqlDataSource>
    </form>
</body>
</html>
